#ifndef _TLSF_H
#define _TLSF_H

#include <cstring>
#include "block.h"
#include "helpers.h"
#include <iostream>
#include <windows.h>


#include "options.h"


const int BITS = 32;

class _tlsf {
	static const int SLI = 4;
	unsigned int L1;
	unsigned int L2[BITS];
	_block *lists[BITS][BITS];

public:
	void clear() {
		memset(this, 0, sizeof(_tlsf));
	}

	_tlsf() {
		clear();
	}

	void insert(_block *pbl);
	_block *get(size_t sz);
	void erase(_block *pbl);
};

#endif // _TLSF_H
